#include<stdio.h>
int main()
{
    char s[100000];
    int k;
    //scanf("%s", s);不可以
    gets(s);
    scanf("%d", &k);
    k = k % 26;
    for(int i = 0; s[i] != '\0'; i ++)
    {
        if((s[i] >= 'a' && s[i] <= 'z') || (s[i] >='A' && s[i] <= 'Z'))
        {
            if((s[i] >= 'a' && s[i] <= 'z' )&& (s[i] + k <= 'z'))
                s[i] += k;
            else if((s[i] >='A' && s[i] <= 'Z') && (s[i] + k <= 'Z'))
                s[i] += k;
            else
                s[i] = s[i] + k - 26;
        }
    }
    //puts(s);正确
    printf("%s", s);//正确
    return 0;
}